Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

fix: Fix iOS redundant payment error #4163

Merged
merged 1 commit into from
May 20, 2024
Merged

fix: Fix iOS redundant payment error #4163

merged 1 commit into from
May 20, 2024

Conversation

jawad-khan
Copy link
Contributor

@jawad-khan jawad-khan commented May 20, 2024

LEARNER-9999

⛔️ MAIN BRANCH WARNING! 2U EMPLOYEES must make branches against the 2u/main BRANCH

  • I have checked the branch to which I would like to merge.

⛔️ DEPRECATION WARNING

This repository is deprecated and in maintainence-only operation while we work on a replacement, please see this announcement for more information.

Although we have stopped integrating new contributions, we always appreciate security disclosures and patches sent to [email protected]

Anyone internally merging to this repository is expected to release and monitor their changes; if you are not able to do this DO NOT MERGE, please coordinate with someone who can to ensure that the changes are released.

Required Testing

  • Before deploying this change, complete a purchase in the stage environment.
    (^ We can remove that manual check once REV-2624 is done and the corresponding e2e test runs again)

Description

iOS users are facing issue where they can't enroll into a course after payment. This is happening to some users because of date mismatch in iOS receipt. This fix has changed date matching attribute from 'receipt_creation_date_ms' to original_purchase_date_ms' which is the correct way to match transaction.
.

Useful information to include:

  • Which edX user roles will this change impact? Common user roles are "Learner", "Course Author", "Developer", and "Operator".
  • Include screenshots for changes to the UI (ideally, both "before" and "after" screenshots, if applicable).
  • Provide links to the description of corresponding configuration changes. Remember to correctly annotate these changes.

Supporting information

Jira Ticket: https://2u-internal.atlassian.net/browse/LEARNER-9999

Testing instructions

Please provide detailed step-by-step instructions for testing this change; how did YOU test this change?

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, OpenEdx vs. edx.org differences, development vs. production environment differences, security, or accessibility.

@jawad-khan jawad-khan requested a review from a team as a code owner May 20, 2024 17:00
Copy link
Contributor

@julianajlk julianajlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming the receipt response will always contain original_purchase_date_ms attribute, might be worth adding try/except on parse_ios_response()

Quick question - on the tests, is there a reason you've added original_purchase_date_ms in the original_test_id purchase but not on the other 2 examples other than the fact that it uses the latest?

@jawad-khan
Copy link
Contributor Author

jawad-khan commented May 20, 2024

@julianajlk Apple is sending this attribute with every request so its safe to assume this, otherwise its good to throw error and tell mobile client we couldn't process request successfully.

On your question, I added it in valid case because if condition will break because of product_id mismatch in other two cases.

@jawad-khan jawad-khan changed the title Fix iOS redundant payment error fix: fix iOS redundant payment error May 20, 2024
@jawad-khan jawad-khan changed the title fix: fix iOS redundant payment error fix: Fix iOS redundant payment error May 20, 2024
@jawad-khan jawad-khan merged commit c211842 into 2u/main May 20, 2024
8 checks passed
@jawad-khan jawad-khan deleted the LEARNER-9999 branch May 20, 2024 18:14
@farhanumar farhanumar requested review from awais786 and removed request for awais786 July 5, 2024 09:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants